package com.atguigu01._this.exer2;

/**
 * ClassName: Bank
 * Package: com.atguigu01._this.exer2
 * Description:
 *
 * @Author xiao_qi
 * @Create 2024/5/9 20:48
 * @Version 1.0
 */
public class Bank {
    private Customer[] customers;//用于保存多个客户
    private int numberOfCustoer;//用于记录存储的客户的个数
    public Bank(){
customers = new Customer[10];

    }
    public void addCustomer(String f,String l){

        Customer cust = new Customer(f,l);
        customers[numberOfCustoer++] = cust;
    }

    public int getNumberOfCustoer() {
        return numberOfCustoer;
    }
    public Customer getCustomer(int index){
        if(index < 0|| index >= numberOfCustoer){
            return null;
        }
        return customers[index];
    }
}
